﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace TB_WS.Class.QN
{
    public class Top_Session
    {
        private static JObject jObj;
        public Top_Session(string TOP_JSON)
        {
            jObj = JObject.Parse(TOP_JSON);
        }
        public string Get_taobao_user_nick()
        {
            JToken taobao_user_nick = jObj.SelectToken("taobao_user_nick");
            return HttpUtility.UrlDecode(taobao_user_nick.ToString(), Encoding.GetEncoding("utf-8"));

        }

        public string Get_re_expires_in()
        {
            JToken re_expires_in = jObj.SelectToken("re_expires_in");
            return re_expires_in.ToString();
        }

        public string Get_expires_in()
        {
            JToken expires_in = jObj.SelectToken("expires_in");
            return expires_in.ToString();
        }

        public string Get_r1_expires_in()
        {
            JToken r1_expires_in = jObj.SelectToken("r1_expires_in");
            return r1_expires_in.ToString();
        }
        public string Get_w2_valid()
        {
            JToken w2_valid = jObj.SelectToken("w2_valid");
            return w2_valid.ToString();
        }
        public string Get_w2_expires_in()
        {
            JToken w2_expires_in = jObj.SelectToken("w2_expires_in");
            return w2_expires_in.ToString();
        }
        public string Get_taobao_user_id()
        {
            JToken taobao_user_id = jObj.SelectToken("taobao_user_id");
            return taobao_user_id.ToString();
        }
        public string Get_w1_expires_in()
        {
            JToken w1_expires_in = jObj.SelectToken("w1_expires_in");
            return w1_expires_in.ToString();
        }
        public string Get_refresh_token()
        {
            JToken refresh_token = jObj.SelectToken("refresh_token");
            return refresh_token.ToString();
        }
        public string Get_refresh_token_valid_time()
        {
            JToken refresh_token_valid_time = jObj.SelectToken("refresh_token_valid_time");
            return refresh_token_valid_time.ToString();
        }
        public string Get_access_token()
        {
            JToken access_token = jObj.SelectToken("access_token");
            return access_token.ToString();
        }
    }
}